FROM openjdk:8-jdk-alpine
# openjdk:14-ea-18-slim
VOLUME /tmp
#ARG JAR_FILE
#ARG target/la-gateway.jar
#COPY ${JAR_FILE} /app.jar
WORKDIR /app
COPY target/la-gateway.jar /app/la-gateway.jar
#ADD ./target/la-auth.jar /app/
# 把arthas安装进docker
#COPY --from=hengyunabc/arthas:latest /opt/arthas /opt/arthas

#指定阿里镜象
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories

# 解决生产验证码没有字体的问题 参考：https://blog.csdn.net/weixin_42389247/article/details/108083842
RUN apk add --update font-adobe-100dpi ttf-dejavu fontconfig

ENV active "dev"
#CMD [echo 'active=' $active]
CMD java -Dspring.profiles.active=$active -Djava.security.egd=file:/dev/./urandom -jar /app/la-gateway.jar
#ENTRYPOINT ["java","-Dspring.profiles.active=$active","-Djava.security.egd=file:/dev/./urandom","-jar", "/app/la-gateway.jar"] # 此方法不能传递参数
#CMD ["$active"]

#RUN java $active -jar /app.jar

# 设置本镜像需要使用的基础镜像
#FROM  ascdc/jdk8
#VOLUME /tmp
# 声明变量
#ARG JAR_FILE
# 把jar包添加到镜像中
#COPY ${JAR_FILE}  app.jar
# 镜像暴露的端口
#EXPOSE 18200
# RUN bash -c 'touch /app.jar'
# 容器启动命令
#ENTRYPOINT ["java","-Dspring.profiles.active=dev","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
# 设置时区
# RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
